$( function() {
	$( ".delete" ).live( 'click',function() {
		$this = $(this);
		if($this.hasClass('ing')){return false;}
		$this.addClass('ing');
		var id =  $this.attr('rel');
		$.get('/Admin/MemberNews/delete',{id:id},function(data){
			if(data.status == 1){
				$this.parent().parent().parent().remove();
			}else{
				alert(data.msg);
			}
		},'json');
	} );
	$('.updateStatus').live('click',function(){
			$this = $(this);
			if($this.hasClass('ing'))return false;
			$this.addClass('ing');
			var id =  $this.attr('rel');
			var type = $this.attr('data-type');
			$.get('/Admin/MemberNews/updatestatus',{id:id,type:type},function(data){
				if(data.status == 1){
					if(type=='stick'){
						if($this.html()=='已置顶'){
							$this.html('未置顶');
						}else{
							$this.html('已置顶');
						}
					}else if(type=='status'){
						if($this.html()=='不能接收'){
							$this.html('可以接收');
						}else{
							$this.html('不能接收');
						}
					}
					$this.removeClass('ing');
					}else{
					alert(data.msg);
				}
			},'json');
	});
} );

